package frankenstein.datastructures;
import java.awt.*;
import java.io.*;
import java.util.*;


public class Scenario extends ParentModel {

	public static final String ADD = "A";
	public static final String CHANGE = "C";
	
	public static final int LONELYCLASSLONELYINTERFACE = 600;
	public static final int LONELYCLASSNOINTERFACE = 100;
	public static final int JOINTCLASSLONELYINTERFACE = 200;
	public static final int JOINTCLASSJOINTINTERFACE = 300;
	public static final int JOINTCLASSNOINTERFACE = 400;
	public static final int TEMPLATEMETHOD = 700;
	//the case with mediator or facade
	public static final int LONELYCLASSJOINTINTERFACE = 500;
	
	public ArrayList<Integer> preferences;
	public double dispatcherCoefficient;
	public double serverCoefficient;
	public double proxyCoefficient;
	
	public double scenarioProbability;
	
	public boolean staticEffect;
	public boolean dynamicEffect;
	public Integer responsibility;
	

	public boolean implementationalChange;
	public boolean semanticChange;
	public String scenarioDescription = "";
	
	protected String type;
	
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	public void setResponsibility(Integer responsibility) {
		this.responsibility = responsibility;
	}

	public Integer getResponsibility(){
		return responsibility;
	}
	public ArrayList<Integer> getScenarioPreferences(){
		
		return this.preferences;
	}

	public void setScenarioPreferences(ArrayList<Integer> newPreferences){
		
		this.preferences = newPreferences;
	}

	public double getDispatcherCoefficient() {
		return dispatcherCoefficient;
	}

	public void setDispatcherCoefficient(double dispatcherCoefficient) {
		this.dispatcherCoefficient = dispatcherCoefficient;
	}

	public double getServerCoefficient() {
		return serverCoefficient;
	}

	public void setServerCoefficient(double serverCoefficient) {
		this.serverCoefficient = serverCoefficient;
	}

	public double getScenarioProbability() {
		return scenarioProbability;
	}

	public void setScenarioProbability(double scenarioProbability) {
		this.scenarioProbability = scenarioProbability;
	}

	public double getProxyCoefficient() {
		return proxyCoefficient;
	}

	public void setProxyCoefficient(double proxyCoefficient) {
		this.proxyCoefficient = proxyCoefficient;
	}

	public boolean getStaticEffect() {
		return staticEffect;
	}

	public void setStaticEffect(boolean staticEffect) {
		this.staticEffect = staticEffect;
	}

	public boolean getDynamicEffect() {
		return dynamicEffect;
	}

	public void setDynamicEffect(boolean dynamicEffect) {
		this.dynamicEffect = dynamicEffect;
	}

	public boolean getImplementationalChange() {
		return implementationalChange;
	}

	public void setImplementationalChange(boolean implementationalChange) {
		this.implementationalChange = implementationalChange;
	}

	public boolean getSemanticChange() {
		return semanticChange;
	}

	public void setSemanticChange(boolean semanticChange) {
		this.semanticChange = semanticChange;
	}

	public String getScenarioDescription() {
		return scenarioDescription;
	}

	public void setScenarioDescription(String scenarioDescription) {
		this.scenarioDescription = scenarioDescription;
	}

	public Scenario createClone() {
		Scenario clone = new Scenario();
		
		clone.setDispatcherCoefficient(dispatcherCoefficient);
		clone.setDynamicEffect(dynamicEffect);
		clone.setImplementationalChange(implementationalChange);
		
		for(Integer preference:preferences){
			clone.getScenarioPreferences().add(new Integer(preference.intValue()));
		}
		//clone.setScenarioPreferences(ArrayList<Integer>preferences.clone());
		
		clone.setProxyCoefficient(proxyCoefficient);
		clone.setResponsibility(responsibility);
		clone.setScenarioDescription(scenarioDescription);
		clone.setScenarioProbability(scenarioProbability);
		clone.setSemanticChange(semanticChange);
		clone.setServerCoefficient(serverCoefficient);
		clone.setStaticEffect(staticEffect);
		clone.setType(type);
		
		
		return clone;
	}

}
